package com.molyfun.parents.rest.bean;

import android.text.TextUtils;

import com.molyfun.parents.rest.BaseResponse;

import java.util.List;

/**
 * Created by william(liuchao.hit@gmail.com).
 * Date:10/31/16.
 */
public class RecordResponse extends BaseResponse {

    private RecordBeanList data;

    public RecordBeanList getData(){
        return data;
    }

    public static class RecordBeanList {

        private int offset;
        private int limit;
        private int total;
        private int size;
        private int pages;
        private int current;
        private boolean searchCount;
        private List<RecordBean> records;
        private Object orderByField;
        private boolean asc;
        private int offsetCurrent;

        public int getOffset() {
            return offset;
        }

        public void setOffset(int offset) {
            this.offset = offset;
        }

        public int getLimit() {
            return limit;
        }

        public void setLimit(int limit) {
            this.limit = limit;
        }

        public int getTotal() {
            return total;
        }

        public void setTotal(int total) {
            this.total = total;
        }

        public int getSize() {
            return size;
        }

        public void setSize(int size) {
            this.size = size;
        }

        public int getPages() {
            return pages;
        }

        public void setPages(int pages) {
            this.pages = pages;
        }

        public int getCurrent() {
            return current;
        }

        public void setCurrent(int current) {
            this.current = current;
        }

        public boolean isSearchCount() {
            return searchCount;
        }

        public void setSearchCount(boolean searchCount) {
            this.searchCount = searchCount;
        }

        public List<RecordBean> getRecords() {
            return records;
        }

        public void setRecords(List<RecordBean> records) {
            this.records = records;
        }

        public Object getOrderByField() {
            return orderByField;
        }

        public void setOrderByField(Object orderByField) {
            this.orderByField = orderByField;
        }

        public boolean isAsc() {
            return asc;
        }

        public void setAsc(boolean asc) {
            this.asc = asc;
        }

        public int getOffsetCurrent() {
            return offsetCurrent;
        }

        public void setOffsetCurrent(int offsetCurrent) {
            this.offsetCurrent = offsetCurrent;
        }
    }

    public static class PlaceHolderRecordBean extends RecordBean{
        private String path;
        private String uploadPath;//上传到七牛的地址
        private int state; // 0代表上传中，1代表失败

        public String getPath() {
            return path;
        }

        public void setPath(String path) {
            this.path = path;
        }

        public int getState() {
            return state;
        }

        public void setState(int state) {
            this.state = state;
        }

        public String getUploadPath() {
            return uploadPath;
        }

        public void setUploadPath(String uploadPath) {
            this.uploadPath = uploadPath;
        }
    }

    public static class RecordBean{

        /**
         * id : b0d7591a99ac49cbb75fe005caaa0f5a
         * content : åååååå3
         * createdatetime : 1478057967000
         * url :
         * type : 4
         */

        private String id;
        private String content;
        private long createdatetime;
        private String studentid;
        private String url;
        private String timelen;
        private int type;
        private String cover;
        private String username;
        private String coursename;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getContent() {
            return content;
        }

        public void setContent(String content) {
            this.content = content;
        }

        public long getCreatedatetime() {
            return createdatetime;
        }

        public void setCreatedatetime(long createdatetime) {
            this.createdatetime = createdatetime;
        }

        public String getStudentid() {
            return studentid;
        }

        public void setStudentid(String studentid) {
            this.studentid = studentid;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        public int getTimelen() {
            if(TextUtils.isEmpty(timelen)){
                return 0;
            }
            int time = Integer.parseInt(timelen);
            return time;
        }

        public void setTimelen(int timelen) {
            this.timelen = timelen + "";
        }

        public int getType() {
            return type;
        }

        public void setType(int type) {
            this.type = type;
        }

        public String getCover() {
            return cover;
        }

        public void setCover(String cover) {
            this.cover = cover;
        }

        public String getUsername() {
            return username;
        }

        public void setUsername(String username) {
            this.username = username;
        }

        public String getCoursename() {
            return coursename;
        }

        public void setCoursename(String coursename) {
            this.coursename = coursename;
        }
    }

}
